package com.hylanda.pb.entity.dict;


/** 
 * @author zhangy
 * @E-mail:blackoon88@gmail.com 
 * @qq:846579287
 * @version created at：2018年1月5日 下午4:31:35 
 * note
 */
public enum ReportMode {
	ViewMode("查看模式","Report.Read"){},
//	EditSaveMode("编辑模式","Report.ReadWrite"){},
//	ViewSaveAsMode("查看另存模式","Report.Read Workspace.Report.Create"){},
	EditSaveAsMode("编辑另存模式","Report.ReadWrite Workspace.Report.Create"){};
//	CreateReportMode("创建报表模式","Dataset.Read Workspace.Report.Create"){};
	private String name;
	private String value;
	private ReportMode(String name,String value){
		this.name=name;
		this.value=value;
	}
	public String getName() {
		return name;
	}
	public String getValue() {
		return value;
	}
	public static ReportMode[] getAllReportMode(){
		return new ReportMode[]{ViewMode,EditSaveAsMode};
	}
	public static String getValue(String name) {
		String v=null;
		for(ReportMode rm: ReportMode.getAllReportMode()){
			if(rm.getName().equals(name)){
				v=rm.getValue();
				break;
			}
		}
		return v;
	}
	public static String getNameByValue(String model) {
		String n=null;
		for(ReportMode rm: ReportMode.getAllReportMode()){
			if(rm.getValue().equals(model)){
				n=rm.getName();
				break;
			}
		}
		return n;
	}
}
